/***************************************************************************
 创建者: 华磊
 开始时间: 2020.8.14
 copyright: (C) 深圳市华友高科有限公司
 修改说明: (每次有修改就添加一条，带有 修改人，修改时间，修改描述)
 example (1) hualei 2020.5.8 类的具体实现代码编写

 ***************************************************************************/
#include "mapgraphicsview.h"
#include <QKeyEvent>
#include <qgraphicsview.h>
#include <qdebug.h>
#include "mapscene.h"


MapGraphicsView::MapGraphicsView(MapScene *mapSceneIn, QWidget *parent) :
    QGraphicsView(parent)
{
    mapScene=mapSceneIn;
    setScene(mapScene);



}

void MapGraphicsView::keyPressEvent(QKeyEvent *event)
{
    qDebug("*********MapGraphicsView::keyPressEvent***************");
    return QGraphicsView::keyPressEvent(event);
}

void MapGraphicsView::keyReleaseEvent(QKeyEvent *event)
{
    qDebug("*********MapGraphicsView::keyReleaseEvent***************");
    return QGraphicsView::keyReleaseEvent(event);
}

void MapGraphicsView::mousePressEvent(QMouseEvent *event)
{
    qDebug("*********MapGraphicsView::mousePressEvent***************");
//    QPointF scenePos=event->scenePos();
//    qDebug()<<"x="<<scenePos.x()<<"y="<<scenePos.y();
//    pressed_x=scenePos.x();
//    pressed_y=scenePos.y();

    QGraphicsView::mousePressEvent(event);
}

void MapGraphicsView::mouseReleaseEvent(QMouseEvent *event)
{
    qDebug("*********MapGraphicsView::mouseReleaseEvent***************");
//    QPointF scenePos=event->scenePos();
//    qDebug()<<"x="<<scenePos.x()<<"y="<<scenePos.y();

    //    released_x=scenePos.x();
    //    released_y=scenePos.y();

    QGraphicsView::mouseReleaseEvent(event);
}
